<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>登录</title>

    <!-- Our CSS stylesheet file -->
    {css href="/static/login/css/styles.css" /}

    <!--[if lt IE 9]>
    {js href="http://html5shiv.googlecode.com/svn/trunk/html5.js" /}
    <![endif]-->
</head>

<body>

<div id="formContainer">
    <form id="login" method="post" action="?">
        <a href="javascript:;"  class="flipLink">登录</a>
        <input type="text" name="username" id="loginEmail" placeholder="用户名"/>
        <input type="password" name="password" id="loginPass" placeholder="密码" />
        <input type="submit" name="submit" value="Login" />
    </form>
</div>



<footer>
    <h2><i>MOBOM</i> 后台管理中心</h2>
    <a class="tzine" href="javascript:;">湖南天涯影视传媒<i><b>有限公司</b></i> 技术支持</a>
</footer>

<!-- JavaScript includes -->
{js href="/node_modules/jquery/dist/jquery.min.js" /}
<script>
    $(function () {
        $('#login').submit(function (e) {
            e.preventDefault();
            var _this = $(this);
            $.ajax({
                type : 'POST',
                url : _this.attr('action'),
                data : _this.serialize(),
                dataType : 'json',
                success : function (msg) {
                    if (msg.code == 200) {
                        window.location.href = '{:url("index")}';
                    } else {
                        alert(msg.msg);
                    }
                }
            });
        });
    });
</script>
</body>
</html>

